package game;

import java.io.Serializable;
import java.util.List;
import java.util.LinkedList;
import application.messages.commands.parameters.Coordinates2D;
import java.util.Random;

public class CavesList implements Serializable
{
	public static CavesList getInstance()
	{
		if (_instance == null)
		{
			_instance = new CavesList();
		}
		
		return _instance;
	}
	
	private CavesList()
	{
		//
	}
	
	public void addNewCave(int x, int y)
	{
		this.cavesCoordinates.add(new Coordinates2D(x, y));
	}
	
	public Coordinates2D getRandomCaveCoordinates()
	{
		return cavesCoordinates.get(new Random().nextInt(cavesCoordinates.size() - 1));
	}
	
	private static CavesList _instance = null;
	
	private List<Coordinates2D> cavesCoordinates = new LinkedList<Coordinates2D>();
}
